From: Marco Trevisan (TreviƱo) Date: Wed, 15 Apr 2026 21:09:00 +0000 (+0200) Subject: appFavorites: Move installed-changed where it belongs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~10^2^2~34 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e63796ded511fed3e9e4c1aa16d2868cb05e80d1;p=gnome-shell.git appFavorites: Move installed-changed where it belongs In the dash we are monitoring the installed applications and reload the favorites, while this is not something that is related to the dash per se, and if the AppFavorites is used to track the favorites elsewhere it would not be updated when new favorite apps are installed. So move the logic to AppFavorites, that will now emit a changed event whenever any favorite changed. Part-of: --- diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js index a4ec6cb30..d13a49066 100644 --- a/js/ui/appFavorites.js +++ b/js/ui/appFavorites.js @@ -12,6 +12,10 @@ class AppFavorites extends Signals.EventEmitter { this._parentalControlsManager.connect('app-filter-changed', () => this._updateFavorites()); + this._appSystem = Shell.AppSystem.get_default(); + this._appSystem.connect('installed-changed', + () => this._updateFavorites()); + this.FAVORITE_APPS_KEY = 'favorite-apps'; this._favorites = {}; global.settings.connect(`changed::${this.FAVORITE_APPS_KEY}`, @@ -39,8 +43,7 @@ class AppFavorites extends Signals.EventEmitter { reload() { const ids = global.settings.get_strv(this.FAVORITE_APPS_KEY); - const appSys = Shell.AppSystem.get_default(); - const apps = ids.map(id => appSys.lookup_app(id)) + const apps = ids.map(id => this._appSystem.lookup_app(id)) .filter(app => app !== null && this._parentalControlsManager.shouldShowApp(app.app_info)); this._favorites = {}; for (let i = 0; i < apps.length; i++) { diff --git a/js/ui/dash.js b/js/ui/dash.js index 9ebd348ee..1a0a84142 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -379,10 +379,7 @@ export const Dash = GObject.registerClass({ this._appSystem = Shell.AppSystem.get_default(); - this._appSystem.connect('installed-changed', () => { - AppFavorites.getAppFavorites().reload(); - this._queueRedisplay(); - }); + this._appSystem.connect('installed-changed', () => this._queueRedisplay()); AppFavorites.getAppFavorites().connect('changed', this._queueRedisplay.bind(this)); this._appSystem.connect('app-state-changed', this._queueRedisplay.bind(this));